﻿using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations;

namespace Batman.UserManagement.UserMamagements
{
    public class CreateInputModel
    {
        [Required(ErrorMessage = "请填写用户名")]
        public string Username { get; set; }

        public string Email { get; set; }

        public string PhoneNumber { get; set; }

        [Required(ErrorMessage = "请设置密码")]
        public string Password { get; set; }

        public IdentityUser ToUser()
        {
            return new IdentityUser
            {
                UserName = Username,
                Email = this.Email,
                PhoneNumber = this.PhoneNumber
            };
        }
    }
}
